package org.elephas.webapp.frontend.page;

import org.apache.wicket.Component;
import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.model.StringResourceModel;
import org.elephas.webapp.frontend.component.FooterPanel;
import org.elephas.webapp.frontend.component.HeaderPanel;

/**
 * Base page. Renders the default header and footer with no content.
 *
 * @See {@link FooterPanel}
 * @see {@link HeaderPanel}
 */
@SuppressWarnings({"unchecked"})
public class BasePage extends AbstractBasePage {
    private static final long serialVersionUID = 1L;

    public BasePage() {
    }

    public BasePage(PageParameters params) {
        super(params);
    }

    @Override
    protected Component newHeader(String id) {
        return new HeaderPanel(id, new StringResourceModel(
            "header.title",
				this, null), (Class<WebPage>) getPageClass(),
            getPageParameters());
    }

    @Override
    protected Component newFooter(String id) {
        return new FooterPanel(id, new StringResourceModel(
            "footer.copyright", this, null));
    }

    @Override
    protected Component newContent(String id) {
        return new WebMarkupContainer(id);
    }
}
